<template>
  <div class="p-10">
    <div v-html="content" />
  </div>
</template>

<script>
import { getByCode } from "@/api/ik/data/dataApi"

export default {
  name: "ShowContent",
  data() {
    return {
      content: "",
      bgPath: "health.content.label.contentinfo",
      id: "",
      code: "content"
    }
  },
  created() {
    // this.bgPath = this.$route.query.bgPath
    this.id = this.$route.query.rowCode
    this.code = this.$route.query.field
    this.getByCode()
  },
  methods: {
    /**
     * 通过id获取信息
     */
    getByCode() {
      const bgPath = this.bgPath.split(".").join("/")
      getByCode(bgPath, this.id).then(res => {
        this.content = res.data.head[this.code]
      })
    }
  }
}
</script>

<style scoped lang="scss">

</style>
